#include <arm_neon.h>
#include <stdio.h>

void v4lconvert_yuyv_to_rgb24_optimized_NEON_final(const unsigned char *src, unsigned char *dest,
  int width, int height);
/*
    if(flag==0){//entra somente uma vez
		
		v4lconvert_yuyv_to_rgb24(buffers[buf.index].start,aux[buf.index].start,1280,720);
		//printf("depois");
		//strcpy(anterior[buf.index].start,buffers[buf.index].start);
		memcpy(anterior[buf.index].start,buffers[buf.index].start,sizeof(unsigned char)*buffers[buf.index].length);
		flag=1;
		
	}
		unsigned char *x = buffers[buf.index].start;
		unsigned char *y = anterior[buf.index].start;
		for(i=0;i<buffers[buf.index].length;i++)
		{
			
			if(x[i]-y[i]!=0)
				pixel_count++;
		}
		
		//printf("pixels %lf\n",(double)(pixel_count/(double)buffers[buf.index].length));
			
		
			if((double)(pixel_count/(double)buffers[buf.index].length)>0.8)
			{
				v4lconvert_yuyv_to_rgb24(buffers[buf.index].start,aux[buf.index].start,1280,720);
				//strcpy(anterior[buf.index].start,buffers[buf.index].start);
				memcpy(anterior[buf.index].start,buffers[buf.index].start,sizeof(unsigned char)*buffers[buf.index].length);				
				process_image ((unsigned char *)aux[buf.index].start);
	
			}
    pixel_count=0;
	 */  
